package com.hs.sfzy.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hs.sfzy.entity.Charge;
import com.hs.sfzy.entity.ChargeType;
import com.hs.sfzy.mapper.ChargeTypeMapper;
import com.hs.sfzy.service.ChargeTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName ChargeTypeServiceImpl
 * @Description TODO
 * @Author liubo
 * @Date 2024年10月21日 10:45
 * @Version 1.0
 */
@Service
public class ChargeTypeServiceImpl implements ChargeTypeService {
    @Autowired
    private ChargeTypeMapper chargeTypeMapper;

    @Override
    public int insert(ChargeType chargeType) {

        return chargeTypeMapper.insert(chargeType);
    }

    @Override
    public int delete(int id) {

        return chargeTypeMapper.delete(id);
    }

    @Override
    public int update(ChargeType chargeType) {

        return chargeTypeMapper.update(chargeType);
    }

    @Override
    public List<ChargeType> selectAll(ChargeType chargeType) {

        return chargeTypeMapper.selectAll(chargeType);
    }

    @Override
    public ChargeType selectById(int id) {

        return chargeTypeMapper.selectById(id);
    }

    @Override
    public PageInfo<ChargeType> selectByPageInfo(int pageNum, int pageSize, ChargeType chargeType) {
        PageHelper.startPage(pageNum,pageSize);
        List<ChargeType> list=chargeTypeMapper.selectAll(chargeType);
        PageInfo<ChargeType> pageInfo=new PageInfo<ChargeType>(list);
        return pageInfo;
    }
}
